package com.zh.zhbootcommon.entity.common;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 定时任务信息记录
 * sys_corn_quartz
 * @author 
 */
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("zh_corn_quartz")
public class DCornQuartz implements Serializable {

    @TableId(value = "corn_id", type = IdType.AUTO)
    private Long cornId;

    /**
     * 类型 1:常规任务 2:特殊任务
     */
    @TableField("type")
    private Integer type;

    /**
     * 任务组
     */
    @TableField("job_group")
    private String jobGroup;

    /**
     * 任务名称
     */
    @TableField("job_name")
    private String jobName;

    /**
     * 参数
     */
    @TableField("invoke_param")
    private String invokeParam;

    /**
     * 定时时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    @TableField("quartz_time")
    private String quartzTime;

    /**
     * 状态 1:待执行 2:已执行
     */
    @TableField("status")
    private Integer status;

    /**
     * 执行任务时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    @TableField("execute_endtime")
    private Date executeEndTime;

    /**
     * 0-未删除 1-已删除
     */
    @TableField("del_flg")
    public Integer delFlg;

    @TableField("create_by")
    public String createBy;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    @TableField("create_time")
    public Date createTime;

    private static final long serialVersionUID = 1L;
}